#ifndef LEGENDWIDGET_H
#define LEGENDWIDGET_H

#include <QWidget>
#include <QLabel>

class AbstractPlot2D;

class LegendWidget : public QWidget
{
Q_OBJECT
public:
    explicit LegendWidget(QWidget *parent = 0);

    QSize sizeHint() const;
    QSize minimumSizeHint() const;
    void setOpacity(int opacity);

    int opacity() const;
    bool frameIsShow() const;

protected:
    void paintEvent(QPaintEvent *event);

signals:

public slots:
    void showFrame(bool isShow);

private:
    enum {Margin = 10, MarkerSize = 40};
    mutable QLabel _label;
    AbstractPlot2D *_plotter;
    int _opacity;
    bool _showFrame;
};

#endif // LEGENDWIDGET_H
